/*
 * IniciaSplash.java
 *
 * Created on 3 de julio de 2007, 11:51
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package administracion.helper;
import gr.zeus.ui.JSplash;
import java.awt.Color;
import java.awt.Font;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;

public class IniciaSplash {
    private JSplash splash;
    private String[] msgCarga;

    private int contPorc;
    
    public IniciaSplash( ) {               


        this.contPorc = 4;
        URL dir_url;
        
        try{            
            dir_url = IniciaSplash.class.getResource("/administracion/propiedades/SPLASH.png");
           
            splash = new JSplash( 
            dir_url, // the image
            true, // do we want a progress bar?
            true, // do we want messages displayed during loading?
            false, // do we want percent displayed instead of messages?
            "Version 1.2 ", // do we want to display a text message at the
                               // bottom-right corner e.g. version number
            new Font("Tahoma", Font.BOLD, 13), // do we want another font?
            new Color( 0, 128, 0 ) ); // do we need another color other than black?
        }catch( Exception er ){
            er.printStackTrace();
        }        
         splash.splashOn();
         System.out.println("se inicio ! "+splash.getName());
         splash.setVisible(true);
    }
    
   
    
    public void cierra(){
        splash.splashOff();
        splash.dispose();
    }
    
    public void avanzar(String mensaje){
        splash.setProgress( this.contPorc, mensaje);

        this.contPorc += 4;       
        
    }      
   
    public static void main(String arg[]){
        try {
            /*IniciaSplash abc=new IniciaSplash(10);
            abc.avanzar("uno");
            abc.avanzar("dos");
            abc.avanzar("tres");
            abc.avanzar("cuatro");
            abc.avanzar("cinco");
            abc.avanzar("seis");
            abc.avanzar("siete");
            abc.avanzar("ocho");
            abc.avanzar("nueve");
            abc.avanzar("diez");*/
           
        } catch (Exception ex) {
            Logger.getLogger(IniciaSplash.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }
}
